home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
187_01
/
getint.c
< prev
next >
Wrap
C/C++ Source or Header
|
1985-12-28
|
884b
|
29 lines
/*@*****************************************************/
/*@ */
/*@ getint - read in two binary bytes and treat them */
/*@ as a reverse 2-byte number. */
/*@ */
/*@ Usage: getint(fp); */
/*@ where fp is a file handle. */
/*@ Returns an int which is the binary value. */
/*@ */
/*@*****************************************************/
#include "stdio.h"
/*******************************************************/
int getint(fp)
FILE *fp; /* File to process */
/*
* Read two binary bytes and treat them as reverse 2-byte number.
*/
{
char c;
c = fgetc(fp);
return(c+(256*fgetc(fp)));
}